<template>
  <el-menu default-active="2" class="el-menu-vertical-demo">
    <el-menu-item index="1">
      <!-- <template #title>订单管理</template> -->
      <router-link class="RouterBtn" to="/" active-class="active" exact>
        <el-icon>
          <House />
        </el-icon>
        首页
      </router-link>
    </el-menu-item>
    <el-sub-menu index="2">
      <template #title>
        <span class="RouterBtn">
          <el-icon>
            <Ship />
          </el-icon>
          宠物商品
        </span>
      </template>
      <el-menu-item-group>
        <el-menu-item index="1-1">
          <router-link to="/issue" active-class="active" exact> 发布商品 </router-link>
        </el-menu-item>
        <el-menu-item index="1-2">
          <router-link to="/manage" active-class="active" exact> 管理商品 </router-link>
        </el-menu-item>
      </el-menu-item-group>
    </el-sub-menu>
    <el-menu-item index="3">
      <template #title>
        <router-link class="RouterBtn" to="/blog" active-class="active" exact>
          <el-icon>
            <Tickets />
          </el-icon>
          公告管理
        </router-link>
      </template>
    </el-menu-item>
    <el-sub-menu index="4">
      <template #title>
        <span class="RouterBtn">
          <el-icon>
            <Star />
          </el-icon>
          宠物
        </span>
      </template>
      <el-menu-item-group>
        <el-menu-item index="3-1"><router-link class="RouterBtn" to="/pets" active-class="active" exact>
            宠物领养
          </router-link></el-menu-item>
        <el-menu-item><router-link class="RouterBtn" to="/petslost" active-class="active" exact>
            挂失寻宠
          </router-link>
        </el-menu-item>
        <el-menu-item><router-link class="RouterBtn" to="/examine" active-class="active" exact>
            领养审批
          </router-link>
        </el-menu-item>
      </el-menu-item-group>
    </el-sub-menu>
    <el-menu-item index="5">
      <template #title>
        <router-link class="RouterBtn" to="/UserManage" active-class="active" exact>
          <el-icon>
            <User />
          </el-icon>
          用户管理
        </router-link>
      </template>
    </el-menu-item>
    <el-menu-item index="6">
      <!-- <template #title>订单管理</template> -->
      <router-link class="RouterBtn" to="/order" active-class="active" exact>
        <el-icon>
          <CreditCard />
        </el-icon>
        订单管理
      </router-link>
    </el-menu-item>
  </el-menu>
</template>

<script lang="ts" setup>
import { ref } from "vue";
import { Document, Menu as IconMenu, Location, Setting } from "@element-plus/icons-vue";
</script>

<style scoped lang="less">
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 200px;
  min-height: 400px;
}

a {
  color: #000;
  text-align: center;
  text-decoration: none;
}

.active {
  color: #409eff;
}

.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 16%;
  height: 90vh;
}

span {
  font-size: 14rem;
}

.el-menu-item {
  font-size: 14rem;
}

// 增加路由按钮的点击区域
.RouterBtn {
  width: 100%;
  text-align: start;
}
</style>
